{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 曲线拟合"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "导入基础包："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib as mpl\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 多项式拟合"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "导入线多项式拟合工具："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from numpy import polyfit, poly1d"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "产生数据："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "x = np.linspace(-5, 5, 100)\n",
    "y = 4 * x + 1.5\n",
    "noise_y = y + np.random.randn(y.shape[-1]) * 2.5"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "画出数据："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEACAYAAACnJV25AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XuUVOWZ7/HvowiIZOiYuMQLCc4KHg14SUgcj060neh4\ngUAyxiSzJBOVnKN4jwEvtApGiQYxMeNMlGMwy0QRHSWOQRMkiT2ZNEKMYmMU42VoLgaNxC4igSDQ\nz/ljV9G7i11Vu25dVbt+n7Vqde1de+96y8tTbz37fZ/X3B0REUmOPWrdABERqSwFdhGRhFFgFxFJ\nGAV2EZGEUWAXEUkYBXYRkYQpK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imJ/89dAtyf7ni8\nDpwbdZAmKImIJEytUzEiIlJhCuwiIgmjwC4ikjAK7CIiCaPALiKSMArsIiIJo8AuIpIwCuwiIgnz\n/wEcY+GYZJlNlgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xa1224a8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "p = plt.plot(x, noise_y, 'rx')\n",
    "p = plt.plot(x, y, 'b:')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "进行线性拟合，`polyfit` 是多项式拟合函数，线性拟合即一阶多项式："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 3.93921315  1.59379469]\n"
     ]
    }
   ],
   "source": [
    "coeff = polyfit(x, noise_y, 1)\n",
    "print coeff"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "一阶多项式 $y = a_1 x + a_0$ 拟合，返回两个系数 $[a_1, a_0]$。\n",
    "\n",
    "画出拟合曲线："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEACAYAAACnJV25AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XuczXX+B/DXm8EUZQxyv1+y5ZoMEmaTiCK71WZJ5CeX\npLYat1EzJbLoorSr3RXtUiiMMllUTiySLY37mmqGRksuM5bCGPP+/fE9pzlznMv33Oac+c7r+Xic\nh3O+53v5HOV9Puf9fX8+H1FVEBGRdZSLdAOIiCi0GNiJiCyGgZ2IyGIY2ImILIaBnYjIYhjYiYgs\nJqjALiKxIrJDRL4Wkf0i8qJ9e7yIbBSRQyKyQUTiQt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iFQCsBLBEVdMi3Z4QuwXAABHpByAWwLUi8ndVHRbhdoVK\nDowMwE776/dhBPYrRDoVkwbgNgAQkZYAKpamoO6Nqu5V1Vqq2kRVm8D4j3JTaQrqvohIXxg/eweq\n6oVItycE/g2ghYg0FpGKMGYp/SDCbQoZMXoYCwHsV1VvU4CUSqo6VVUb2P+9PQDgUwsFdajqMQDf\n22MlANwOYJ+7fcPeY/fhLQBvicgeAPkALPMfwQ0r/sx/HUBFABvtv0q2q+q4yDYpcKpaICLjAawH\nUB7AQlV1W3VQSnUDMBTAbhFxjBSfoqr/jGCbwsmK/+YeA7DU3vH4FsAIdztxgBIRkcVEOhVDREQh\nxsBORGQxDOxERBbDwE5EZDEM7EREFsPATkRkMQzsREQWw8BORGQx/w/bVCtp0vAwowAAAABJRU5E\nrkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xa1ec278>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "p = plt.plot(x, noise_y, 'rx')\n",
    "p = plt.plot(x, coeff[0] * x + coeff[1], 'k-')\n",
    "p = plt.plot(x, y, 'b--')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "还可以用 `poly1d` 生成一个以传入的 `coeff` 为参数的多项式函数："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEACAYAAACnJV25AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VNX5x/HPUQSrqBG0gkKFVlCRxRWpuKRWBfelrZZq\nXX9WxaVUQXaICkgBtyqttFK1dUFbqVXRYlRSWlS0LgEUJGqC0lZESQQrS0Ke3x93xtwMs9zJzGQm\nN9/36zWv2e5yhuWZM899zjnOzBARkfDYLt8NEBGR7FJgFxEJGQV2EZGQUWAX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xzRwCPA9/OdZuyKcXnGw34J0FrcT2IJJ9vjJk9HdlmLLDFzB5p1sZlXxh/um/DOdce+DPw80jP\nPRScc6cBn5rZW8654ny3JwfaAIcC15jZ6865O4FRwIR4G+aUmZ2Y6D3n3FXA3Mh2r0cuMHY0s89z\n3a5sSfT5nHO98b5hy51z4KUp3nDO9TezT5uxiRlJ9vcH4Jy7GO+n7/ebpUG59W+gq+95V7xee2g4\n53YAngAeMrMn892eLDsKOMM5dwqwI7Crc+4PZnZhntuVLavxMgCvR57/GS+wbyPfqZgngeMBnHM9\ngbYtKagnY2bLzGwvM+tuZt3x/lIObUlBPRXn3GC8n71nmtmmfLcnC/4F9HDOdXPOtcWbpfSpPLcp\na5zXw5gNvGtmyaYAaZHMbIyZdY38f/sx8FKIgjpm9gnwcSRWApwAvBNv25z32FP4PfB759xSYAsQ\nmr+EOML4M/9uoC1QGvlV8oqZDc1vk5rOzOqcc9cA84HtgdlmFrfqoIUaCFwALHHORUeKjzazv+Wx\nTbkUxv9z1wIPRzoeHwCXxNtIA5REREIm36kYERHJMgV2EZGQUWAXEQkZBXYRkZBRYBcRCRkFdhGR\nkFFgFxEJGQV2EZGQ+X/DyfQNy7jRVwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xa25e1d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "f = poly1d(coeff)\n",
    "p = plt.plot(x, noise_y, 'rx')\n",
    "p = plt.plot(x, f(x))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "poly1d([ 3.93921315,  1.59379469])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "显示 `f`："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      "3.939 x + 1.594\n"
     ]
    }
   ],
   "source": [
    "print f"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "还可以对它进行数学操作生成新的多项式："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "       2\n",
      "31.03 x + 29.05 x + 6.674\n"
     ]
    }
   ],
   "source": [
    "print f + 2 * f ** 2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 多项式拟合正弦函数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "正弦函数："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x = np.linspace(-np.pi,np.pi,100)\n",
    "y = np.sin(x)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "用一阶到九阶多项式拟合，类似泰勒展开："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "y1 = poly1d(polyfit(x,y,1))\n",
    "y3 = poly1d(polyfit(x,y,3))\n",
    "y5 = poly1d(polyfit(x,y,5))\n",
    "y7 = poly1d(polyfit(x,y,7))\n",
    "y9 = poly1d(polyfit(x,y,9))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD7CAYAAACRxdTpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXl8VOX1/993Jnsy2fcNAoSdEAggqwZFUBS1ti5tv9+q\nrdX6tbW16+9rW7eqVdtva611rQu2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w8JWDbdIVQggv\nIYRP6d+9gWdRn19NUJ67PpglhGiPOYxwBohwsD26QEpZLISIBL4FXIEVKlNGcx4ANgpzpxg34Asp\n5VbHmqQPVCqkQqFQ6BAVllEoFAodosRdoVAodIgSd4VCodAhStwVCoVChyhxVygUCh2ixF2hUCh0\niBJ3hUKh0CFK3BUKhUKH/AdKQZTK2jwwogAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xa3f1e80>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = np.linspace(-3 * np.pi,3 * np.pi,100)\n",
    "\n",
    "p = plt.plot(x, np.sin(x), 'k')\n",
    "p = plt.plot(x, y1(x))\n",
    "p = plt.plot(x, y3(x))\n",
    "p = plt.plot(x, y5(x))\n",
    "p = plt.plot(x, y7(x))\n",
    "p = plt.plot(x, y9(x))\n",
    "\n",
    "a = plt.axis([-3 * np.pi, 3 * np.pi, -1.25, 1.25])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "黑色为原始的图形，可以看到，随着多项式拟合的阶数的增加，曲线与拟合数据的吻合程度在逐渐增大。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 最小二乘拟合"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "导入相关的模块："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from scipy.linalg import lstsq\n",
    "from scipy.stats import linregress"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0xbc98518>]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAEACAYAAABWLgY0AAAABHNCSVQICAgIfA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TuTwJHgNeFrksglwFX9XLRtwE/Y2afC1ynYNz9O70/vwf8\nDVH6e4PQQf6fgJeb2ZyZnQv8EtEgK5lhZmbAAnDS3T8euj4hmdkLzKzVe/wc4HLgeNhaheHuv+fu\nW919G/AO4Ovu/q7Q9QrBzJ5rZuf1HvcHmib2zAsa5N39h8B7ga8CJ4EvzHAPituAu4ELzOwxM/u1\n0HUKaCdwNfDmXvew42Z2RehKBfIi4Ou9nPwx4HZ3vytwnapiltO9m4F/iP27OOzuf5dUUIOhREQa\nLHS6RkRECqQgLyLSYAryIiINpiAvItJgCvIiIg2mIC8i0mAK8iIiDaYgLyLSYP8Pt2y1T8p57b8A\nAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xbc0e320>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = np.linspace(0,5,100)\n",
    "y = 0.5 * x + np.random.randn(x.shape[-1]) * 0.35\n",
    "\n",
    "plt.plot(x,y,'x')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "一般来书，当我们使用一个 N-1 阶的多项式拟合这 M 个点时，有这样的关系存在：\n",
    "\n",
    "$$XC = Y$$\n",
    "\n",
    "即\n",
    "\n",
    "$$\\left[ \\begin{matrix}\n",
    "x_0^{N-1} & \\dots & x_0 & 1 \\\\\\\n",
    "x_1^{N-1} & \\dots & x_1 & 1 \\\\\\\n",
    "\\dots & \\dots & \\dots & \\dots \\\\\\\n",
    "x_M^{N-1} & \\dots & x_M & 1\n",
    "\\end{matrix}\\right] \n",
    "\\left[ \\begin{matrix} C_{N-1} \\\\\\ \\dots \\\\\\ C_1 \\\\\\ C_0 \\end{matrix} \\right] =\n",
    "\\left[ \\begin{matrix} y_0 \\\\\\ y_1 \\\\\\ \\dots \\\\\\ y_M \\end{matrix} \\right]$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Scipy.linalg.lstsq 最小二乘解"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "要得到 `C` ，可以使用 `scipy.linalg.lstsq` 求最小二乘解。\n",
    "\n",
    "这里，我们使用 1 阶多项式即 `N = 2`，先将 `x` 扩展成 `X`："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.05050505,  1.        ],\n",
       "       [ 0.1010101 ,  1.        ],\n",
       "       [ 0.15151515,  1.        ],\n",
       "       [ 0.2020202 ,  1.        ]])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X = np.hstack((x[:,np.newaxis], np.ones((x.shape[-1],1))))\n",
    "X[1:5]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "求解："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([ 0.50432002,  0.0415695 ]),\n",
       " 12.182942535066523,\n",
       " 2,\n",
       " array([ 30.23732043,   4.82146667]))"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "C, resid, rank, s = lstsq(X, y)\n",
    "C, resid, rank, s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "画图："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "sum squared residual = 12.183\n",
      "rank of the X matrix = 2\n",
      "singular values of X = [ 30.23732043   4.82146667]\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAEACAYAAABWLgY0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt0VOW5P/DvQwAvP1mMa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WrlDVf9LVXuoam8AVwF4\nRVXHu10vN4jIqSLSKXo/NtA0ac88V4O8qjYDmArgLwB2AHimgHtQ/AnAGwDOE5H9InK923VyURmA\nsQAujnYP2yYiI9yulEvOBvBKNCe/CcBKVX3Z5Tp5RSGne4sBvBb3d7FKVV9KVpCDoYiIfMztdA0R\nEdmIQZ6IyMcY5ImIfIxBnojIxxjkiYh8jEGeiMjHGOSJiHyMQZ6IyMf+P3gCky4HG7kGAAAAAElF\nTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xa25ed30>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "p = plt.plot(x, y, 'rx')\n",
    "p = plt.plot(x, C[0] * x + C[1], 'k--')\n",
    "print \"sum squared residual = {:.3f}\".format(resid)\n",
    "print \"rank of the X matrix = {}\".format(rank)\n",
    "print \"singular values of X = {}\".format(s)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Scipy.stats.linregress 线性回归"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对于上面的问题，还可以使用线性回归进行求解："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.50432001884393252, 0.041569499438028901)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "slope, intercept, r_value, p_value, stderr = linregress(x, y)\n",
    "slope, intercept"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "R-value = 0.903\n",
      "p-value (probability there is no correlation) = 8.225e-38\n",
      "Root mean squared error of the fit = 0.156\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAEACAYAAABWLgY0AAAABHNCSVQICAgIfAhkiAAA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U6uUdUPoj8PAliJSPq7HbeD/DYA54pIsYh0BvBf\niAyyogImIgKgAsBOVf0ft+vjJhE5U0QC0funABgN4E13a+UOVf1vVe2tqv0AXAPgZVWd5Ha93CAi\np4pIl+j92EDTpD3zXA3yqtoCYCaAPwHYCeDpAu5B8QcArwE4T0T2i8j33K6Ti0oBTABwUbR72Jsi\nMsbtSrnkbAAvR3PyWwCsUdWXXK6TVxRyurc7gFfj/i7WquqLyQpyMBQRkY+5na4hIiIbMcgTEfkY\ngzwRkY8xyBMR+RiDPBGRjzHIExH5GIM8EZGPMcgTEfnY/we7I5NFwW+W8wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xbff7e10>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "p = plt.plot(x, y, 'rx')\n",
    "p = plt.plot(x, slope * x + intercept, 'k--')\n",
    "print \"R-value = {:.3f}\".format(r_value)\n",
    "print \"p-value (probability there is no correlation) = {:.3e}\".format(p_value)\n",
    "print \"Root mean squared error of the fit = {:.3f}\".format(np.sqrt(stderr))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "可以看到，两者求解的结果是一致的，但是出发的角度是不同的。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 更高级的拟合"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from scipy.optimize import leastsq"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "先定义这个非线性函数：$y = a e^{-b sin( f x + \\phi)}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def function(x, a , b, f, phi):\n",
    "    \"\"\"a function of x with four parameters\"\"\"\n",
    "    result = a * np.exp(-b * np.sin(f * x + phi))\n",
    "    return result"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "画出原始曲线："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAAEACAYAAACTXJylAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHTBJREFUeJzt3XmUlNWd//H3l2aTRRCDiEYDCi5RkEVZ5AcUAkLUGB0C\nahYTzagz43YSzcTEOZGZzBxjMs7kzBATJ2DGLYr7Oi6INKAgKrIvggsKEVqUtUGxgfv741bZ0DTd\nVdX11H2eqs/rnDpd3VVd9T3d1Z+6/X3uvY855xARkeRoFroAERHJjYJbRCRhFNwiIgmj4BYRSRgF\nt4hIwii4RUQSpsHgNrNjzGyGmS0zs6Vmdl366xPNbJ2ZLUhfxhanXBERsYbmcZvZkcCRzrmFZtYO\nmA9cAEwAtjvn/qM4ZYqISEbzhm50zm0ANqSvV5vZCuDo9M0WcW0iIlKPrHvcZtYN6Au8lv7StWa2\nyMymmFnHCGoTEZF6ZBXc6TbJI8D1zrlq4A9Ad6APsB64PbIKRURkPw32uAHMrAXwDPCcc+539dze\nDXjaOderzte1CYqISB6ccw22ohubVWLAFGD5vqFtZl33uduFwJKDPHliL7fcckvwGlR/+DpUf/Iu\nSa7duezGuw0enASGAN8DFpvZgvTXfgFcYmZ9AAe8D1yV1bOJiEiTNTar5BXqH5U/F005IiLSGK2c\nPIhUKhW6hCZR/WGp/nCSXHu2Gj04mfcDm7moHltEpFSZGa4pBydFRCR+FNwiIgmj4BYRSRgFt4hI\nwii4RUQSRsEtIpIwCm4RkYRRcIuIJIyCW0QkYRTcIiIJo+AWEUkYBbeISMIouEVEEkbBLSKSMApu\nEZGEUXCLiCSMgltEJGEU3CIiCaPgFhFJmAbP8i4SB3PnwgcfHPj1igo491xo06b4NYmEpJMFS6wt\nWgSjRsHIkQfe9u67MHAgTJpU/LpEopLNyYIV3BJbe/bA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5OZBdyyrkkuBv5ysBujCG4d7YyB\ndJvkEeD69Mg7MZxze51zfYCvAsPMLBW4pKyY2XnAx865BSR01AoMcc71Bb4BXJ1uHSZFc6AfcIdz\nrh+wA7gpbEm5M7OWwDeBhw92nyiC+6/AMft8fgx+1C1FYmYtgEeB+5xzT4SuJ1/pf3OfBU4PXUuW\nzgTOT/eJHwDOMrN7AteUE+fc+vTHjcDj+NZnUqwD1jnn3kh//gg+yJPmG8D89O+gXlEE95tATzPr\nln7nuAh4KoLnkXqYmQFTgOXOud+FridXZvYVM+uYvn4IMBpYELaq7DjnfuGcO8Y51x3/r+7LzrlL\nQ9eVLTNrY2bt09fbAmcDiZld5ZzbAKw1sxPSXxoFLAtYUr4uwb/xH1S+uwMeVNIX55jZA8Bw4HAz\nWwv80jn358Bl5WII8D1gsZllAu/nzrnnA9aUi67A3emj6s2Ae51z0wPXlK+ktQ27AI/7936aA/c7\n514MW1LOrgXuTw8a3wUuC1xPTtJvmKOABo8vaAGOiEjC6FwuIiIJo+AWEUkYBbeISMIouEVEEkbB\nLSKSMApuEZGEUXCLiCSMgltEJGH+Px9Ir5f410BLAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xa6f17f0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = np.linspace(0, 2 * np.pi, 50)\n",
    "actual_parameters = [3, 2, 1.25, np.pi / 4]\n",
    "y = function(x, *actual_parameters)\n",
    "p = plt.plot(x,y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "加入噪声："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEACAYAAACqOy3+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4FGW2BvD3EBgFAgRIlIiQ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utgAA\nAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xa3f1c18>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from scipy.stats import norm\n",
    "y_noisy = y + 0.8 * norm.rvs(size=len(x))\n",
    "p = plt.plot(x, y, 'k-')\n",
    "p = plt.plot(x, y_noisy, 'rx')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Scipy.optimize.leastsq"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "定义误差函数，将要优化的参数放在前面："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def f_err(p, y, x):\n",
    "    return y - function(x, *p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "将这个函数作为参数传入 `leastsq` 函数，第二个参数为初始值："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([ 3.03199715,  1.97689384,  1.30083191,  0.6393337 ]), 1)"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c, ret_val = leastsq(f_err, [1, 1, 1, 1], args=(y_noisy, x))\n",
    "c, ret_val"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`ret_val` 是 1~4 时，表示成功找到最小二乘解："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEACAYAAACqOy3+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtYlWW6P/DvjQfUEUOdUjIVtAH9FaO5t1SSDRWWx84n\nt82v7JeXM9sOY6lZzJW492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InIDgBHAXyhqt+b\nrslDfwUwHkCF6UK8pAA+E5H/FZFRpovxQAyA4yKyUES2icg8EWlluigvPQzg/fruEKgA55FRC3C2\nTz4B8IxzJG4bqlqhqr0BXAXgZhFJMlyS20RkKIBjqrodNhzFOiWq6nUABgEY42wp2kFTAH0AzFXV\nPgB+ATBMfTByAAABfElEQVTRbEmeE5HmAIYB+Li++wUqwAsAdK52uzMco3AKEhFpBmA5gCWq+qnp\nerzlfPubDuDfTdfigX4A7nT2kT8AcKuIvGu4Jo9UXuOhqscBrICjLWoHBwEcVNWtztufwBHodjMI\nwHfO33+dAhXg/wvgNyIS7XwleQjAPwL0WFSLiAiABQC+V9WZpuvxlIj8unJuHRFpCWAAgO1mq3Kf\nqr6oqp1VNQaOt8EbVfX/mq7LXSLSSkQinJ//CsDtqONCPatR1SMADohIrHNTMoDdBkvy1nA4Xvzr\n5cuFPHVS1Qsi8iSAdXAcgFpgpzMgAEBEPgDwOwDtReQAgJdUdaHhstyVCOARADtFpDL4XrDRlL9R\nABY7j8KHAXhPVT83XJMv7NZS7ABghWMcgKYAlqrqerMleeQpAEudg8efAIw0XI9HnC+ayQAaPPbA\nC3mIiGyKS6oREdkUA5yIyKYY4ERENsUAJyKyKQY4EZFNMcCJiGyKAU5EZFMMcCIim/r/11ToLEwg\nA5MAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xa3d7b00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "p = plt.plot(x, y_noisy, 'rx')\n",
    "p = plt.plot(x, function(x, *c), 'k--')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Scipy.optimize.curve_fit"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "更高级的做法："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from scipy.optimize import curve_fit"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "不需要定义误差函数，直接传入 `function` 作为参数："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "p_est, err_est = curve_fit(function, x, y_noisy)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 3.03199711  1.97689385  1.3008319   0.63933373]\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEACAYAAACqOy3+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtYlWW6P/DvjQfUEUOdUjIVtAH9FaO5t1SSDRWWx84n\nt82v7JeXM9sOY6lZzJW492Sp5ZiOVltNLS07OMYoHsuYzCzcqYimUgGj4jk5SOIJ7t8fayEHF7DO\nz/suvp/r4pL1smDdwru+61n3+77PI6oKIiKynzDTBRARkXcY4ERENsUAJyKyKQY4EZFNMcCJiGyK\nAU5EZFNuBbiIdBaRL0Rkt4jsEpGnndtTReSgiGx3fgwMbLlERFRJ3DkPXEQ6AuioqjtEpDWA7wDc\nDeBBAKdUdUZgyyQiotqaunMnVT0C4Ijz81IR2QOgk/PLEqDaiIioHh73wEUkGsB1AL5xbnpKRLJE\nZIGIRPqxNiIiqodHAe5sn3wC4BlVLQXwJoAYAL0BHAbwut8rJCIil9zqgQOAiDQDsArAGlWd6eLr\n0QBWqmp8re2cbIWIyAuqWm+L2t2zUATAAgDfVw9vEYmqdrd7AGTXUYRtPyZNmmS8hsZav51rZ/3m\nP+xevzvcOogJIBHAIwB2ish257YXAQwXkd4AFEAegNFu/jwiIvKRu2ehfAXXo/U1/i2HiIjcxSsx\nG5CUlGS6BJ/YuX471w6wftPsXr873D6I6fUDiGigH4OIKNSICNQfBzGJiMh6GOBERDbFACcisikG\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qerMleeQpAEudg8efAIw0XI9HnC+ayQAaPPbA\nC3mIiGyKS6oREdkUA5yIyKYY4ERENsUAJyKyKQY4EZFNMcCJiGyKAU5EZFMMcCIim/r/11ToLEwg\nA5MAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xa22b828>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "print p_est\n",
    "p = plt.plot(x, y_noisy, \"rx\")\n",
    "p = plt.plot(x, function(x, *p_est), \"k--\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "这里第一个返回的是函数的参数，第二个返回值为各个参数的协方差矩阵："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 0.08483704 -0.02782318  0.00967093 -0.03029038]\n",
      " [-0.02782318  0.00933216 -0.00305158  0.00955794]\n",
      " [ 0.00967093 -0.00305158  0.0014972  -0.00468919]\n",
      " [-0.03029038  0.00955794 -0.00468919  0.01484297]]\n"
     ]
    }
   ],
   "source": [
    "print err_est"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "协方差矩阵的对角线为各个参数的方差："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "normalized relative errors for each parameter\n",
      "   a\t  b\t f\tphi\n",
      "[ 0.09606473  0.0488661   0.02974528  0.19056043]\n"
     ]
    }
   ],
   "source": [
    "print \"normalized relative errors for each parameter\"\n",
    "print \"   a\\t  b\\t f\\tphi\"\n",
    "print np.sqrt(err_est.diagonal()) / p_est"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
